package com.itheima.arrlist;

import com.itheima.object1.Student;

import java.util.ArrayList;

public class ArrayListDemo03 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        Student student = new Student("张三","18");
        Student student1 = new Student("李四","18");
        Student student2 = new Student("王五","18");
        list.add(student);
        list.add(student1);
        list.add(student2);
        for (int i = 0; i < list.size(); i++) {
            Student s = list.get(i);
            System.out.println(s.getName()+""+s.getAge());
        }

    }
}
